<a href='https://github.com/angular/angular.js/edit/v1.4.x/src/loader.js?message=docs(angular.Module)%3A%20describe%20your%20change...#L3' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit">&nbsp;</i>Improve this Doc</a>



<a href='https://github.com/angular/angular.js/tree/v1.4.7/src/loader.js#L3' class='view-source pull-right btn btn-primary'>
  <i class="glyphicon glyphicon-zoom-in">&nbsp;</i>View Source
</a>


<header class="api-profile-header">
  <h1 class="api-profile-header-heading">angular.Module</h1>
  <ol class="api-profile-header-structure naked-list step-list">
    
    <li>
      - type in module <a href="api/ng">ng</a>
    </li>
  </ol>
</header>



<div class="api-profile-description">
  <p>Interface for configuring angular <a href="api/ng/function/angular.module">modules</a>.</p>

</div>




<div>
  

    

  

  
<h2>Methods</h2>
<ul class="methods">
  <li id="provider">
    <h3><p><code>provider(name, providerType);</code></p>

</h3>
    <div><p>See <a href="api/auto/service/$provide#provider">$provide.provider()</a>.</p>
</div>

    
    <h4>Parameters</h4>
    
<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        name
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a>
      </td>
      <td>
        <p>service name</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        providerType
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-function">Function</a>
      </td>
      <td>
        <p>Construction function for creating new instance of the
                               service.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

    

    
    
    

  </li>
  
  <li id="factory">
    <h3><p><code>factory(name, providerFunction);</code></p>

</h3>
    <div><p>See <a href="api/auto/service/$provide#factory">$provide.factory()</a>.</p>
</div>

    
    <h4>Parameters</h4>
    
<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        name
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a>
      </td>
      <td>
        <p>service name</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        providerFunction
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-function">Function</a>
      </td>
      <td>
        <p>Function for creating new instance of the service.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

    

    
    
    

  </li>
  
  <li id="service">
    <h3><p><code>service(name, constructor);</code></p>

</h3>
    <div><p>See <a href="api/auto/service/$provide#service">$provide.service()</a>.</p>
</div>

    
    <h4>Parameters</h4>
    
<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        name
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a>
      </td>
      <td>
        <p>service name</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        constructor
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-function">Function</a>
      </td>
      <td>
        <p>A constructor function that will be instantiated.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

    

    
    
    

  </li>
  
  <li id="value">
    <h3><p><code>value(name, object);</code></p>

</h3>
    <div><p>See <a href="api/auto/service/$provide#value">$provide.value()</a>.</p>
</div>

    
    <h4>Parameters</h4>
    
<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        name
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a>
      </td>
      <td>
        <p>service name</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        object
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-object">*</a>
      </td>
      <td>
        <p>Service instance object.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

    

    
    
    

  </li>
  
  <li id="constant">
    <h3><p><code>constant(name, object);</code></p>

</h3>
    <div><p>Because the constant are fixed, they get applied before other provide methods.
See <a href="api/auto/service/$provide#constant">$provide.constant()</a>.</p>
</div>

    
    <h4>Parameters</h4>
    
<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        name
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a>
      </td>
      <td>
        <p>constant name</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        object
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-object">*</a>
      </td>
      <td>
        <p>Constant value.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

    

    
    
    

  </li>
  
  <li id="decorator">
    <h3><p><code>decorator(The, This);</code></p>

</h3>
    <div><p>See <a href="api/auto/service/$provide#decorator">$provide.decorator()</a>.</p>
</div>

    
    <h4>Parameters</h4>
    
<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        The
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a>
      </td>
      <td>
        <p>name of the service to decorate.</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        This
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-function">Function</a>
      </td>
      <td>
        <p>function will be invoked when the service needs to be
                                   instantiated and should return the decorated service instance.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

    

    
    
    

  </li>
  
  <li id="animation">
    <h3><p><code>animation(name, animationFactory);</code></p>

</h3>
    <div><p><strong>NOTE</strong>: animations take effect only if the <strong>ngAnimate</strong> module is loaded.</p>
<p>Defines an animation hook that can be later used with
<a href="api/ng/service/$animate">$animate</a> service and directives that use this service.</p>
<pre><code class="lang-js">module.animation(&#39;.animation-name&#39;, function($inject1, $inject2) {
  return {
    eventName : function(element, done) {
      //code to run the animation
      //once complete, then run done()
      return function cancellationFunction(element) {
        //code to cancel the animation
      }
    }
  }
})
</code></pre>
<p>See <a href="api/ng/provider/$animateProvider#register">$animateProvider.register()</a> and
<a href="api/ngAnimate">ngAnimate module</a> for more information.</p>
</div>

    
    <h4>Parameters</h4>
    
<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        name
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a>
      </td>
      <td>
        <p>animation name</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        animationFactory
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-function">Function</a>
      </td>
      <td>
        <p>Factory function for creating new instance of an
                                   animation.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

    

    
    
    

  </li>
  
  <li id="filter">
    <h3><p><code>filter(name, filterFactory);</code></p>

</h3>
    <div><p>See <a href="api/ng/provider/$filterProvider#register">$filterProvider.register()</a>.</p>
<div class="alert alert-warning">
<strong>Note:</strong> Filter names must be valid angular <a href="guide/expression"><code>Expressions</code></a> identifiers, such as <code>uppercase</code> or <code>orderBy</code>.
Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace
your filters, then you can use capitalization (<code>myappSubsectionFilterx</code>) or underscores
(<code>myapp_subsection_filterx</code>).
</div></div>

    
    <h4>Parameters</h4>
    
<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        name
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a>
      </td>
      <td>
        <p>Filter name - this must be a valid angular expression identifier</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        filterFactory
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-function">Function</a>
      </td>
      <td>
        <p>Factory function for creating new instance of filter.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

    

    
    
    

  </li>
  
  <li id="controller">
    <h3><p><code>controller(name, constructor);</code></p>

</h3>
    <div><p>See <a href="api/ng/provider/$controllerProvider#register">$controllerProvider.register()</a>.</p>
</div>

    
    <h4>Parameters</h4>
    
<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        name
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a><a href="" class="label type-hint type-hint-object">Object</a>
      </td>
      <td>
        <p>Controller name, or an object map of controllers where the
   keys are the names and the values are the constructors.</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        constructor
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-function">Function</a>
      </td>
      <td>
        <p>Controller constructor function.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

    

    
    
    

  </li>
  
  <li id="directive">
    <h3><p><code>directive(name, directiveFactory);</code></p>

</h3>
    <div><p>See <a href="api/ng/provider/$compileProvider#directive">$compileProvider.directive()</a>.</p>
</div>

    
    <h4>Parameters</h4>
    
<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        name
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a><a href="" class="label type-hint type-hint-object">Object</a>
      </td>
      <td>
        <p>Directive name, or an object map of directives where the
   keys are the names and the values are the factories.</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        directiveFactory
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-function">Function</a>
      </td>
      <td>
        <p>Factory function for creating new instance of
directives.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

    

    
    
    

  </li>
  
  <li id="config">
    <h3><p><code>config(configFn);</code></p>

</h3>
    <div><p>Use this method to register work which needs to be performed on module loading.
For more about how to configure services, see
<a href="guide/providers#provider-recipe">Provider Recipe</a>.</p>
</div>

    
    <h4>Parameters</h4>
    
<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        configFn
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-function">Function</a>
      </td>
      <td>
        <p>Execute this function on module load. Useful for service
   configuration.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

    

    
    
    

  </li>
  
  <li id="run">
    <h3><p><code>run(initializationFn);</code></p>

</h3>
    <div><p>Use this method to register work which should be performed when the injector is done
loading all modules.</p>
</div>

    
    <h4>Parameters</h4>
    
<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        initializationFn
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-function">Function</a>
      </td>
      <td>
        <p>Execute this function after injector creation.
   Useful for application initialization.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

    

    
    
    

  </li>
  </ul>
  
  
<h2>Properties</h2>
<ul class="properties">
  <li id="requires">
    <h3><code>requires</code></h3>
    <table class="variables-matrix return-arguments">
  <tr>
    <td></td>
    <td><p>Holds the list of modules which the injector will load before the current module is
loaded.</p>
</td>
  </tr>
</table>
  </li>
  
  <li id="name">
    <h3><code>name</code></h3>
    <table class="variables-matrix return-arguments">
  <tr>
    <td></td>
    <td><p>Name of the module.</p>
</td>
  </tr>
</table>
  </li>
  </ul>



  
</div>


